<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<form id="myForm" class="form-horizontal" action="chushou/add" method="post">
    <div class="form-group">
        <label for="cs_name" class="col-sm-3 control-label">姓名<span style="color: #d63635;">(必填)</span></label>
        <div class="col-sm-9">
            <input type="text" name="cs_name" class="form-control" id="cs_name" placeholder="请输入姓名">
        </div>
    </div>
    <div class="form-group">
        <label for="cs_shouji" class="col-sm-3 control-label">联系方式<span style="color: #d63635;">(必填)</span></label>
        <div class="col-sm-9">
            <input type="text" name="cs_shouji" class="form-control" id="cs_shouji" placeholder="请输入联系方式">
        </div>
    </div>
    <div class="form-group">
        <label for="cs_shenfen" class="col-sm-3 control-label">身份证号<span style="color: #d63635;">(必填)</span></label>
        <div class="col-sm-9">
            <input type="text" name="cs_shenfen" class="form-control" id="cs_shenfen" placeholder="请输入身份证号">
        </div>
    </div>
    <div class="form-group">
        <label for="cs_dizhi" class="col-sm-3 control-label">住址<span style="color: #d63635;">(必填)</span></label>
        <div class="col-sm-9">
            <input type="text" name="cs_dizhi" class="form-control" id="cs_dizhi" placeholder="请输入住址">
        </div>
    </div>

    <div class="tushu">
        <div class="form-group">
            <label class="col-sm-3 control-label">图书编号<span style="color: #d63635;">(必填)</span></label>
            <div class="col-sm-9">
                <input type="text" name="list" class="form-control ts_id" onkeyup="chang(this)"  placeholder="请输入编号">
            </div>
        </div>
        <div class="form-group" style="display: none;">
            <label class="col-sm-3 control-label">图书名称</label>
            <div class="col-sm-9">
                <input type="text" name="ts_name" class="form-control ts_name"  disabled="disabled">
            </div>
        </div>
        <div class="form-group" style="display: none;">
            <label class="col-sm-3 control-label">图书价格</label>
            <div class="col-sm-9">
                <input type="text" name="ts_jine" class="form-control ts_jine"   disabled="disabled">
            </div>
        </div>
    </div>

    <div class="tushu" style="display: none;">
        <div class="form-group">
            <label class="col-sm-3 control-label">图书编号</label>
            <div class="col-sm-9">
                <input type="text" name="list" class="form-control ts_id" onkeyup="chang(this)"  placeholder="请输入编号">
            </div>
        </div>
        <div class="form-group" style="display: none;">
            <label class="col-sm-3 control-label">图书名称</label>
            <div class="col-sm-9">
                <input type="text" name="ts_name" class="form-control ts_name"  disabled="disabled">
            </div>
        </div>
        <div class="form-group" style="display: none;">
            <label class="col-sm-3 control-label">图书价格</label>
            <div class="col-sm-9">
                <input type="text" name="ts_jine" class="form-control ts_jine"   disabled="disabled">
            </div>
        </div>
    </div>

    <div class="tushu" style="display: none;">
        <div class="form-group">
            <label class="col-sm-3 control-label">图书编号</label>
            <div class="col-sm-9">
                <input type="text" name="list" class="form-control ts_id" onkeyup="chang(this)"  placeholder="请输入编号">
            </div>
        </div>
        <div class="form-group"  style="display: none;">
            <label class="col-sm-3 control-label">图书名称</label>
            <div class="col-sm-9">
                <input type="text" name="ts_name" class="form-control ts_name"  disabled="disabled">
            </div>
        </div>
        <div class="form-group"  style="display: none;">
            <label class="col-sm-3 control-label">图书价格</label>
            <div class="col-sm-9">
                <input type="text" name="ts_jine" class="form-control ts_jine"   disabled="disabled">
            </div>
        </div>
    </div>

    <div class="form-group col-sm-10" >
        <label for="cs_jine" class="col-sm-4 control-label">总价</label>
        <div class="col-sm-8">
            <input type="text" name="cs_jine" class="form-control" id="cs_jine" value="0.0"  disabled="disabled">
        </div>
    </div>

</form>
<script>
    $("#show").append("<img height='200px' width='200px'id=\"showw\" src=\"\">");
    var book_img = document.getElementById("img").value;
    //  显示要修改的图片
    $("#showw").attr("src",book_img);
    //         单击图片按钮显示出来
    $('#book_img').on('change',function() {
        $("#show").text("");
        //加载选择图片
        var r= new FileReader();
        f=document.getElementById('book_img').files[0];
        r.readAsDataURL(f);
        r.onload=function  (e) {
            $("#show").append("<img width='200px' height='200px' id=\"showw\" src=\"\">");
            document.getElementById('showw').src=this.result;
        };
    })
</script>